import VueRouter from 'vue-router'

const routes = [
  {
    name: '首页',
    path: '/',
    component: () => import(/* webpackChunkName: "layout" */ '@/layout/index'),
    children: [
      {
        name: '默认首页',
        path: '/',
        component: () => import('@/views/home/index'),
      },
      {
        name: 'role2',
        path: '/role2/index',
        component: () => import('@/views/role2/index'),
      },
    ],
  },
  {
    name: '登录',
    path: '/login',
    component: () =>
      import(/* webpackChunkName: "login" */ '@/views/login/index'),
  },

  // {
  //   // 匹配所有路径  vue2使用*   vue3使用/:pathMatch(.*)*或/:pathMatch(.*)或/:catchAll(.*)
  //   path: '*',
  //   name: '404',
  //   component: () => import('@/views/NoFind/404'),
  // },
]

const router = new VueRouter({ routes })

export default router
// /^\/role2\/index(?:\/(?=$))?$/i
// /^\/role2\/index(?:\/(?=$))?$/i
